package com.zmn.plat.business.impl.channel;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.common.dto.StatusDTO;
import com.zmn.plat.business.interfaces.channel.ChannelTypeBService;
import com.zmn.plat.model.entity.channel.ChannelType;
import com.zmn.plat.services.interfaces.channel.ChannelTypeService;

/**
 * 描述:ChannelTypeBServiceImpl
 *
 * @author tanghongjun
 * @since: 2018/10/16 17:56
 */
@Service
public class ChannelTypeBServiceImpl implements ChannelTypeBService {
    @Resource
    protected ChannelTypeService channelTypeService;

    @Override
    public Integer updateStatus(Integer typeId, Integer status, String updater) {
        ChannelType channelType = new ChannelType();
        channelType.setTypeId(typeId);
        channelType.setStatus(status);
        channelType.setUpdater(updater);
        return this.updateStatus(channelType);
    }

    @Override
    public Integer updateStatus(ChannelType channelType) {

        int pos = channelTypeService.updateStatus(channelType);

        return pos;
    }

    @SuppressWarnings("Duplicates")
    @Override
    public Integer updateStatusBatch(List<Integer> typeIds, Integer status, String updater) {
        StatusDTO dto = new StatusDTO();
        dto.setIds(typeIds);
        dto.setStatus(status);
        dto.setUpdater(updater);

        return this.updateStatusBatch(dto);
    }

    @Override
    public Integer updateStatusBatch(StatusDTO dto) {

        int pos = channelTypeService.updateStatusBatch(dto);

        return pos;
    }
}
